const path = require('path')
const pagesList = require('../../route/index.js')
const projectPath = path.join(__dirname, '../../')
const typeOfUtils = require("../utils/type-of-utils");

class ReaderPages {
  /**
   * @return {String[]}
   */
  static getPagesPath() {
    let pages = pagesList()
    pages = pages
      .filter(i => {
        return typeOfUtils.isNotEmpty(i.path)
      })
      .map(i => path.join(projectPath, i.path) + '.vue')
    if (typeOfUtils.isEmpty(pages)) {
      return []
    }
    return pages
  }
}

module.exports = ReaderPages
